<%@page import="com.wanmait.movies.vo.Maneger"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>

<script type="text/javascript " src="<%=request.getContextPath()%>/js/jquery-3.5.1.min.js"></script>

	<% Maneger m =(Maneger)session.getAttribute("maneger");
	if(m==null){
	response.sendRedirect(request.getContextPath()+"/manegerlog.jsp");
	}%>

<style type="text/css">
	#ablelist{
	width:1205px;
	
	margin:auto;
	
	}
	
	#ablelist ul{
	width:224px;
	background-color:#222;
	padding:0px 5px;
	margin:0px 0px;
	list-style:none;
	text-align: center;
	border:2px solid gray;
	border-radius: 10px;
	}
	
	#ablelist ul>li{
	background-color:white;
	width:200px;
	height:70px;
	padding:0px;
	margin:25px 0px;
	line-height:70px;
	font-size:30px;
	border:2px solid gray;
	border-radius: 10px;
	}
	.reportnum{
	width:20px;
	height:20px;
	float:right;
	background:red;
	color:white;
	font-weight:bold;
	margin-top:-10px;
	margin-right:-10px;
	line-height:20px;
	border-radius: 10px;
	font-size:15px;
	
	}
	#ablelist ul>li:hover{
	width:220px;
	height:90px;
	}
	#ablelist a{
	 text-decoration: none;
	 color:gray;
	}
	#able{
	width:200px;
	float:left;

	}
	#frame{
	width:950px;
	margin-left:50px;
	float:left;
	border:2px solid gray;
	border-radius: 10px;
	}
	
	#ableiframe{
	width:950px;
	height:700px;
	border:0px;
	}
	
	
	body{
	background-color: #efefef;

	}
</style>

<script type="text/javascript">
	$(function(){
		$(".lilist1").click(function(){
			
			$("#ableiframe").attr("src","<%=request.getContextPath()%>/ManegerServlet?action=getReportHistory");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=getReportCount",
				async:false,
				type:"get",
				
				success:function(s){
					if(s=="0"){
						$(".reportnum").css("display","none");
					}else{
						$(".reportnum").css("display","block");
					}
				
				}
			});
		});
	});
	
	$(function(){
		$(".lilist2").click(function(){
			$("#ableiframe").attr("src","<%=request.getContextPath()%>/ManegerServlet?action=requestAddMovie");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=getReportCount",
				async:false,
				type:"get",
				
				success:function(s){
					if(s=="0"){
						$(".reportnum").css("display","none");
					}else{
						$(".reportnum").css("display","block");
					}
					
				}
			});
		});
	});$(function(){
		$(".lilist3").click(function(){
			$("#ableiframe").attr("src","<%=request.getContextPath()%>/ManegerServlet?action=requestDeleteMovie");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=getReportCount",
				async:false,
				type:"get",
				
				success:function(s){
					if(s=="0"){
						$(".reportnum").css("display","none");
					}else{
						$(".reportnum").css("display","block");
					}
					
					
				}
			});
		});
	});
	
	$(function(){
		$(".lilist4").click(function(){
			$("#ableiframe").attr("src","<%=request.getContextPath()%>/ManegerServlet?action=requestModifymovie");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=getReportCount",
				async:false,
				type:"get",
				
				success:function(s){
		
					if(s=="0"){
						$(".reportnum").css("display","none");
					}else{
						$(".reportnum").css("display","block");
					}
					
				}
			});
		});
	});
	
	//信息维护
	$(function(){
		$(".lilist5").click(function(){
			
			$("#ableiframe").attr("src","<%=request.getContextPath()%>/ManegerServlet?action=requestMessagejsp");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=getReportCount",
				async:false,
				type:"get",
				
				success:function(s){
					if(s=="0"){
						$(".reportnum").css("display","none");
					}else{
						$(".reportnum").css("display","block");
					}
				
				}
			});
		});
	});
	
	
	$(function(){
		$(".relilist").click(function(){
			$("#ableiframe").attr("src","<%=request.getContextPath()%>/ManegerServlet?action=requestManegerReport");
			$(".reportnum").css("display","none");
		});
	});
</script>
</head>
<body>
	<jsp:include page="/ManegerServlet?action=getManeger"></jsp:include>
	<jsp:include page="/include/manegerHead.jsp"></jsp:include>
	
	<hr width="1205" align="center" size="4" color="gray">
	
	<div id="ablelist">
		<div id="able">
			<ul>
				<li class="lilist1"><a href="javascript:void(0);">消息记录</a></li>
				<li class="lilist2"><a href="javascript:void(0);">添加电影</a></li>
				<li class="lilist3"><a href="javascript:void(0);">删除电影</a></li>
				<li class="lilist4"><a href="javascript:void(0);">管理电影</a></li>
				<li class="lilist5"><a href="javascript:void(0);">信息维护</a></li>
				<li class="relilist">
				        <a href="javascript:void(0);">管理举报</a>
						<%int a = (int)request.getAttribute("count");%>
						
							<span class="reportnum" 
							<%if(a==0){%>
								style="display:none;"	
							<%} %>>
						
							<%=a %>
						    </span>	
						
				</li>
			</ul>
	    </div>
	    
	    <div id="frame">
	    <iframe id="ableiframe" src="<%=request.getContextPath()%>/ManegerServlet?action=getReportHistory">
	    
	    </iframe>
	    </div>
	</div>
</body>
</html>